package com.project.controller;


import com.project.entity.Order;
import com.project.entity.OrderCount;
import com.project.service.ITOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zhangyang
 * @since 2021-10-06
 */
@RestController
@RequestMapping("/order")
public class TOrderController {

    @Autowired
    private ITOrderService orderService;

    @GetMapping("orderInfo")
    public List<Order> find(String code, LocalDate time, String who) {
        return orderService.findByCodeAndTime(code, time, who);
    }

    @GetMapping("orderCount")
    public OrderCount findCount(String code, LocalDate time, String who) {
        return orderService.findCount(code, time, who);
    }


}
